package com.biwano.swapmyjob.tools;

public class StringMaker {
	
	private String string;
	public static final int PARAMETER_NAME=0;
	public static final int PARAMETER_VALUE=1;
	
	public StringMaker(String str)
	{
		string = new String (str);
	}
	public StringMaker setParameters(Object[][] allParams)
	{
		for (Object[] params : allParams) {
			setParameter(params);
		}	
		return this;
	}
	public StringMaker setParameter(Object[] params)
	{
		setParameter(params[StringMaker.PARAMETER_NAME].toString(),
				params[StringMaker.PARAMETER_VALUE].toString());
		return this;
	}
	
	public StringMaker setParameter(String param,String value)
	{
		string=string.replace(":"+param, value);
		return this;
	}
	public String getString()
	{
		return string;
	}
}
